import asyncio
import time

from playwright.async_api import async_playwright


async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=False)
        page = await browser.new_page()
        # await page.goto("http://localhost:88/test/toPage")
        await page.goto("https://www.baidu.com")
        await page.fill('input[name="wd"]','周纯彬')
        await page.hover('#login > section > button')
        print(await page.title())

        await page.locator('#sel').click()
        await page.wait_for_timeout(1000)
        await page.locator("#sel").select_option(index=1)



        time.sleep(2)
        await browser.close()

asyncio.run(main())
